package com.eastfair.venuebooking.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * The type Contact ref dto.
 *
 * @author dqq
 * @date 2022 /6/24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
public class ContactRefDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface Important {
    }

    @ApiModelProperty(value = "联系人关联关系id")
    private Long id;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    private Integer isEnabled;
    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    private Integer isDeleted;
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    private Long subsystemId;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 联系人id
     */
    @NotNull(message = "联系人id不可为空", groups = {ContactRefDTO.Important.class})
    @ApiModelProperty(value = "联系人id")
    private Long contactId;
    /**
     * 客户id, 商机id
     */
    @NotNull(message = "业务id不可为空", groups = {ContactRefDTO.Important.class})
    @ApiModelProperty(value = "客户id, 商机id")
    private Long subjectId;
    /**
     * 模块类型，枚举，1.客户 2.商机
     */
    @ApiModelProperty(value = "模块类型，枚举，1.客户 2.商机")
    @NotBlank(message = "业务类型不可为空", groups = {ContactRefDTO.Important.class})
    @Size(max = 20, message = "模块类型，枚举，1.客户 2.商机长度不能超过20", groups = {ContactRefDTO.Important.class})
    private String subjectType;
    /**
     * 是否是主要联系人 0。否 1是
     */
    @NotNull(message = "是否是主要联系人不可为空", groups = {ContactRefDTO.Important.class})
    @ApiModelProperty(value = "是否是主要联系人 0。否 1是")
    private Boolean important;

    @ApiModelProperty(value = "业务id列表")
    private List<Long> subjectIds;

    @ApiModelProperty(value = "联系人id列表")
    private List<Long> contactIds;
}
